The Accordion Pane Component > FAccordionPane.setChangeHandler()

 

FAccordionPane.setChangeHandler()

Availability

Flash Player 6.

Usage

myAccordion_acp.setChangeHandler (handler, scope)

Parameters

handler A string specifying the function which should be called when the selected section of the component changes.
scope An Object in which the specified function will be called.

Returns


Nothing

Description

Specifies the function to be called when the selected section of the component changes. If the second parameter is passed in, the function will be called within the scope of that object. Otherwise, _parent is used.

Example

The following code adds four sections to the component, and then defines a change handler which will be called when the selected section of the component changes.

var sections = ["Section 1","Section 2","Section 3","Section 4"];
	myAccordionPane_acp.setDataProvider(sections);
	myAccordionPane_acp.setChangeHandler("onPaneSelect"); 

	function onPaneSelect(pane){
	trace("Selected Index: "+pane.getSelectedIndex()); // traces "Selected Index: 2";
	} 

	myAccordionPane_acp.setSelectedIndex(2);